<template>
  <div class="icon"  :style="{'width': width+'px', 'height': height+'px'}">
    <img v-if="url" :src="url" alt="头像">
    <img v-else src="../../assets/images/icon/defined-icon.png" alt="头像">
  </div>
</template>

<script>
export default {
  data() {
    return {
      
    }
  },
  created() {
    console.log('url',this.url)
  },
  // props: ['width', 'height', 'url'],
  props: {
    'width': {
      type: Number,
      default: 60},
    'height': {
      type: Number,
      default: 60},
    'url': {
      type: String},
  }
}
</script>

<style lang="scss" scoped>
.icon {
  display: inline-block;
  border-radius: 3px;
  border: 1px solid #bbbbbb;
  img {
    width: 100%;
    height: 100%;
  }
}
</style>